<?php
class ManageAuth{
     private $CI;
     public function __construct()
     {
         $this->CI = &get_instance();  //获取CI对象
     }
     //权限认证
     public function auth()
     {
         $this->CI->load->helper('url');
         if(preg_match("/blog.*/i",uri_string()))
         {
            //需要进行权限检查的url
            $this->CI->load->library('session');
            if(!$this->CI->session->userdata('username')){
                 //用户未登录
				print('无访问权限');
                redirect(WEB_SITE.'welcome/index','refresh');
				//die('/welcome/index');
            }
         }
     }
 }